package com.hyf.translucentstatusbar.activity;

import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.hyf.translucentstatusbar.R;
import com.hyf.translucentstatusbar.widget.ScrollListenerScrollView;

import butterknife.BindView;
import butterknife.ButterKnife;

public class HeaderActivity extends Base {

    @BindView(R.id.sv_header_activity)
    ScrollListenerScrollView mScrollView;
    @BindView(R.id.iv_header_image)
    ImageView headImage;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_header);
        ButterKnife.bind(this);
        toolBar.setTitle("HeaderActivity");
        setDisplayHomeAsUpEnabled();
        setHeaderBarScrollChange(mScrollView, headImage.getLayoutParams().height);
    }

    @Override
    protected Drawable onHeaderBarDrawable() {
        int[] colors = {getResources().getColor(R.color.colorPrimary), getResources().getColor(R.color.colorPrimaryLight)};
        return new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, colors);
    }

    @Override
    protected Object onHeaderBarImage() {
        return R.mipmap.image01;
    }

    @Override
    protected boolean isImageHeader() {
        return true;
    }
}
